﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;

namespace FileTransSystem.ViewModel
{
    public class DataGridViewModel  
    {
        public DataGridViewModel()
        {
            Items2 = CreateData();
        }

      
        private static void SelectAll(bool select, IEnumerable<SelectableViewModel> models)
        {
            foreach (var model in models)
            {
                model.IsSelected = select;
            }
        }

        private static ObservableCollection<SelectableViewModel> CreateData()
        {
            return new ObservableCollection<SelectableViewModel>
            {
                new SelectableViewModel
                {
                },
                new SelectableViewModel
                {
                },
                new SelectableViewModel
                {
                }
            };
        }

        public ObservableCollection<SelectableViewModel> Items2 { get; }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        public IEnumerable<string> Foods => new[] { "Burger", "Fries", "Shake", "Lettuce" };
    }
}